package com.cskt.common.entity.vo;

import java.io.Serializable;
import java.util.List;

/**
 * 分页查询展示实体类
 *
 * @author admin
 * @date 2023/04/15 14:33
 **/

public class PageVO<T> implements Serializable {

    /**
     *当前页，默认为第1页
     */
    private Integer pageNo=1;
    /**
     * 每页记录数
     */
    private Integer pageSize=10;
    /**
     * 总记录数
     */
    private Integer total;
    /**
     * 总页数
     */
    private Integer pages;
    //分页查询中当前页的数据
    private List<T> list;

    public Integer getPageNo() {
        return pageNo;
    }

    public void setPageNo(Integer pageNo) {
        this.pageNo = pageNo;
    }

    public Integer getPageSize() {
        return pageSize;
    }

    public void setPageSize(Integer pageSize) {
        this.pageSize = pageSize;
    }

    public Integer getTotal() {
        return total;
    }

    public void setTotal(Integer total) {
        this.total = total;
    //    同步计算总页数 
        this.pages = (this.total % this.pageSize == 0) ? this.total / this.pageSize : this.total / this.pageSize + 1;
    }

    public Integer getPages() {
        return pages;
    }

    public void setPages(Integer pages) {
        this.pages = pages;
    }

    public List<T> getList() {
        return list;
    }

    public void setList(List<T> list) {
        this.list = list;
    }
}
